const cloud = require('wx-server-sdk')
cloud.init({
  env: 'database-2p2zg'
})
const db = cloud.database()
const req = db.collection('school-request')
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  try {
    return await req.doc(event.pageID).update({
      data: {
        comment: event.comment,
        refer:event.refer
      },
    })
  } catch (e) {
    console.error(e)
  }
}